<template>
  <el-container>
    <el-aside width="200px">
      <el-row class="tac">
        <el-col :span="12">
          <div id="corInfo">
            <el-image
              style="width: 100px; height: 100px"
              :src="require('@/assets/aaa.png')"
              fit="scale-fown"
            ></el-image>
          </div>
          <!-- 自己封装的菜单 -->
          <nav-menu :menus="menus"></nav-menu>
        </el-col>
      </el-row>
    </el-aside>
    <el-container>
      <el-header>
        <user-info></user-info>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
      <el-footer>
        <footer-info></footer-info>
      </el-footer>
    </el-container>
  </el-container>
</template>

<script>
import UserInfo from "./UserInfo.vue";
import FooterInfo from "./FooterInfo.vue";
import NavMenu from "./nav/NavMenu.vue";
export default {
  components: { UserInfo, FooterInfo, NavMenu },
  //     methods: {
  //   handleOpen(key, keyPath) {
  //     console.log(key, keyPath);
  //   },
  //   handleClose(key, keyPath) {
  //     console.log(key, keyPath);
  //   }
  // }
  data: function () {
    return {
      menus: [
        {
          title: "仪表盘",
          path: "/",
        },
        {
          title: "文章管理",
          path: "/article",
          children: [
            {
              title: "类别管理",
              path: "/article/category",
            },
            {
              title: "作者管理",
              path: "/article/author",
            },
            {
              title: "文章管理",
              path: "/article/article",
            },
          ],
        },
        {
          title: "系统设置",
          path: "/system",
          children: [
            {
              title: "用户管理",
              path: "/system/user",
              children: [
                {
                  title: "头像管理",
                  path: "/system/user/avatar",
                },
                {
                  title: "地址管理",
                  path: "/system/user/address",
                },
                {
                  title: "好友管理",
                  path: "/system/user/friend",
                },
              ],
            },
            {
              title: "角色管理",
              path: "/system/role",
            },
            {
              title: "权限管理",
              path: "/system/permission",
            },
          ],
        },
      ],
    };
  },
  methods:{
    handleOpen(key,keyPath){
      console.log(key,keyPath);
    },
    handleClose(key,keyPath){
      console.log(key,keyPath);
    }
  }
};
</script>

<style>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.el-menu-vertical-demo:not(.el-menu-collapse) {
  width: 200px;
  min-height: 400px;
}
/* .el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-col-12 {
  width: 100% !important;
}
.el-submenu .el-menu-item {
  min-width: none !important;
} */
.el-menu {
  height: calc(100vh - 61px);
}
.el-aside {
  overflow: hidden !important;
}
/* html {
  overflow: hidden !important;
} */
.el-avatar {
  margin-right: 5px !important;
}
#corInfo {
  height: 60px;
}
</style>